#include<stdio.h>
int main()
#pragma warning(disable:4996)
{
	int a;
	int b;
	scanf("%d %d", &a, &b);
	int t1 = (a / 100) * 60 + (a % 100);
	int t2 = (b / 100) * 60 + (b % 100);
	int t = t1 + t2;
	int T = (t / 60) * 1000 + (t % 60);
	printf("time=%d", T);
	return 0;
}